package com.ithinkblog.code404.android.emissary.tools;

import java.util.ArrayList;

import android.content.Context;
import android.telephony.SmsManager;

public class SendSmsTo implements ICommand {
	//private Context context;
	private String receiver;
	private String message;
	
	public SendSmsTo(Context context , String receiver , String message){
		//this.context = context;
		this.receiver = receiver;
		this.message = message;
	}
	@Override
	public void execute() {
		SmsManager manager = SmsManager.getDefault();
		ArrayList<String> texts = manager.divideMessage(message);
		for(String text : texts){
			manager.sendTextMessage(receiver, null, text, null, null);
		}
	}

}
